<include file="public@header"/>
<link rel="stylesheet" href="__TMPL__/public/assets/css/animation.css">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title">
                            {:lang('ADMIN_SETTING_SITE')}<span
                                class="layui-badge-rim page-content">设置网站的数据参数及其它设置</span>
                        </div>
                    </div>
                    <div class="layui-tab layui-tab-brief">
                        <ul class="layui-nav layui-tab-title " id="tabHeader">
                            <li class="layui-this layui-nav-item">
                                {:lang('WEB_SITE_INFOS')}
                            </li>
                            <li class="layui-nav-item">{:lang('SEO_SETTING')}</li>
                            <li class="layui-nav-item">APP版本管理</li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-page-content">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form js-ajax-form" role="form" action="{:url('setting/sitePost')}" method="post"
                          wid110>
                        <div class="layui-tab-content" id="tabBody">

                            <div class="layui-tab-item layui-show">
                                <div class="layui-form-item">
                                    <label for="input-site-name" class="layui-form-label"><span
                                            class="form-required">*</span>{:lang('WEBSITE_NAME')}</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-site-name"
                                               name="options[site_name]"
                                               value="{$site_info.site_name|default=''}">
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <label for="input-site_url" class="layui-form-label"><span
                                            class="form-required">*</span>站点域名</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-site_url"
                                               name="options[site_url]" value="{$site_info.site_url|default=''}">
                                        格式： http(s)://xxxx.com(:端口号)
                                    </div>
                                </div>
                                <div class="layui-form-item" style="display:none;">
                                    <label for="input-admin_url_password" class="layui-form-label">
                                        后台加密码
                                        <a href="http://www.thinkcmf.com/faq.html?url=https://www.kancloud.cn/thinkcmf/faq/493509"
                                           title="查看帮助手册"
                                           data-toggle="tooltip"
                                           target="_blank"><i class="fa fa-question-circle"></i></a>
                                    </label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-admin_url_password"
                                               name="admin_settings[admin_password]"
                                               value="{$admin_settings.admin_password|default=''}"
                                               id="js-site-admin-url-password">
                                        <p class="help-block">英文字母数字，不能为纯数字</p>
                                        <p class="help-block" style="color: red;">
                                            设置加密码后必须通过以下地址访问后台,请劳记此地址，为了安全，您也可以定期更换此加密码!</p>
                                        <php>
                                            $root=cmf_get_root();
                                            $root=empty($root)?'':'/'.$root;
                                            $site_domain = cmf_get_domain().$root;
                                        </php>
                                        <p class="help-block">后台登录地址：<span id="js-site-admin-url">{$site_domain}/{$admin_settings.admin_password|default='admin'}</span>
                                        </p>
                                    </div>
                                </div>

                                <div class="layui-form-item" style="display:none;">
                                    <label for="input-site_admin_theme" class="layui-form-label">后台模板</label>
                                    <div class="layui-input-block">
                                        <php>
                                            $site_admin_theme=empty($admin_settings['admin_theme'])?'':$admin_settings['admin_theme'];
                                        </php>
                                        <select class="layui-input" name="admin_settings[admin_theme]"
                                                id="input-site_admin_theme">
                                            <foreach name="admin_themes" item="vo">
                                                <php>$admin_theme_selected = $site_admin_theme == $vo ? "selected" :
                                                    "";
                                                </php>
                                                <option value="{$vo}" {$admin_theme_selected}>{$vo}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                </div>
                                <div class="layui-form-item" style="display:none;">
                                    <label for="input-site_adminstyle" class="layui-form-label">{:lang('WEBSITE_ADMIN_THEME')}</label>
                                    <div class="layui-input-block">
                                        <php>
                                            $site_admin_style=empty($admin_settings['admin_style'])?cmf_get_admin_style():$admin_settings['admin_style'];
                                        </php>
                                        <select class="layui-input" name="admin_settings[admin_style]"
                                                id="input-site_adminstyle">
                                            <foreach name="admin_styles" item="vo">
                                                <php>$admin_style_selected = $site_admin_style == $vo ? "selected" :
                                                    "";
                                                </php>
                                                <option value="{$vo}" {$admin_style_selected}>{$vo}</option>
                                            </foreach>
                                        </select>
                                    </div>
                                </div>
                                <if condition="APP_DEBUG && false">
                                    <div class="layui-form-item">
                                        <label for="input-default_app" class="layui-form-label">默认应用</label>
                                        <div class="layui-input-block">
                                            <php>
                                                $site_default_app=empty($cmf_settings['default_app'])?'demo':$cmf_settings['default_app'];
                                            </php>
                                            <select class="layui-input" name="cmf_settings[default_app]"
                                                    id="input-default_app">
                                                <foreach name="apps" item="vo">
                                                    <php>$default_app_selected = $site_default_app == $vo ? "selected" :
                                                        "";
                                                    </php>
                                                    <option value="{$vo}" {$default_app_selected}>{$vo}</option>
                                                </foreach>
                                            </select>
                                        </div>
                                    </div>
                                </if>

                                <div class="layui-form-item">
                                    <label for="input-site_phone" class="layui-form-label">联系电话</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-site_phone"
                                               name="options[site_phone]"
                                               value="{$site_info.site_phone|default=''}">
                                    </div>
                                </div>
                                
                                <div class="layui-form-item layui-form-text">
                                    <label for="input-copyright" class="layui-form-label">版权信息</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" id="input-copyright" name="options[copyright]"
                                                  maxlength="200">{$site_info.copyright|default=''}</textarea>
                                        版权信息（200字以内）
                                    </div>
                                </div>


                                

                                <div class="layui-form-item">
                                    <label class="layui-form-label">官方微信</label>
                                    <div class="layui-input-block">
                                        <input type="hidden" name="options[wx_url]" id="thumb" value="{$site_info.wx_url}">
                                        <a href="javascript:uploadOneImage('图片上传','#thumb');">

                                            <if condition="empty($site_info.wx_url)">
                                                <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                                     id="thumb-preview"
                                                     style="cursor: pointer;max-width:150px;max-height:150px;"/>
                                                <else/>
                                                <img src="{:cmf_get_image_preview_url($site_info.wx_url)}"
                                                     id="thumb-preview" width="135" style="cursor: hand"/>
                                            </if>

                                        </a>
                                        <div class="layui-col-md12" style="margin-top: 10px">
                                            <input type="button" class="layui-btn layui-btn-sm layui-btn-normal"
                                                   onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
                                                   value="取消图片">
                                        </div>
                                    </div>
                                </div>


                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="submit" class="layui-btn js-ajax-submit" data-refresh="1">
                                            {:lang('SAVE')}
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <label for="input-site_seo_title" class="layui-form-label">{:lang('WEBSITE_SEO_TITLE')}</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-site_seo_title"
                                               name="options[site_seo_title]"
                                               value="{$site_info.site_seo_title|default=''}">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-site_seo_keywords" class="layui-form-label">{:lang('WEBSITE_SEO_KEYWORDS')}</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-site_seo_keywords"
                                               name="options[site_seo_keywords]"
                                               value="{$site_info.site_seo_keywords|default=''}">
                                    </div>
                                </div>
                                <div class="layui-form-item layui-form-text">
                                    <label for="input-site_seo_description" class="layui-form-label">{:lang('WEBSITE_SEO_DESCRIPTION')}</label>
                                    <div class="layui-input-block">
                                <textarea class="layui-textarea" id="input-site_seo_description"
                                          name="options[site_seo_description]">{$site_info.site_seo_description|default=''}</textarea>
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="submit" class="layui-btn js-ajax-submit" data-refresh="0">
                                            {:lang('SAVE')}
                                        </button>
                                    </div>
                                </div>
                            </div>

                            <div class="layui-tab-item">
                                <div class="layui-form-item">
                                    <label for="input-apk_ver" class="layui-form-label">APK版本号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-apk_ver" name="options[apk_ver]" value="{$site_info.apk_ver|default=''}"> 安卓APP版本号，请勿随意修改
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-apk_url" class="layui-form-label">APK下载链接</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-apk_url" name="options[apk_url]" value="{$site_info.apk_url|default=''}">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-apk_des" class="layui-form-label">APK更新说明</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" id="input-apk_des" name="options[apk_des]" maxlength="100">{$site_info.apk_des|default=''}</textarea> 100字以内
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-ipa_ver" class="layui-form-label">IPA版本号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-ipa_ver" name="options[ipa_ver]" value="{$site_info.ipa_ver|default=''}"> IOS APP版本号，请勿随意修改
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-ios_shelves" class="layui-form-label">IPA上架版本号</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-ios_shelves" name="options[ios_shelves]" value="{$site_info.ios_shelves|default=''}"> IOS上架审核中版本的版本号(用于上架期间隐藏上架版本部分功能,不要和IPA版本号相同),上架成功后要修改
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-ipa_url" class="layui-form-label">IPA下载链接</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" id="input-ipa_url" name="options[ipa_url]" value="{$site_info.ipa_url|default=''}">
                                    </div>
                                </div>
                                <div class="layui-form-item">
                                    <label for="input-ipa_des" class="layui-form-label">IPA更新说明</label>
                                    <div class="layui-input-block">
                                        <textarea class="layui-textarea" id="input-ipa_des" name="options[ipa_des]" maxlength="100">{$site_info.ipa_des|default=''}</textarea> 100字以内
                                    </div>
                                </div>

                                <div class="layui-form-item">
                                    <div class="layui-input-block">
                                        <button type="submit" class="layui-btn js-ajax-submit" data-refresh="0">
                                            {:lang('SAVE')}
                                        </button>
                                    </div>
                                </div>
                            </div>

               
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<include file="public@script"/>
</body>
</html>
